<?php

/**
 * wengdo前台首页
 * author wang
 */

define("PHP_IN",true);
require "include/init.php";
require ROOT_PATH."smarty_connection.php";


$sql = "SELECT * FROM news WHERE isdisplay=1 ORDER BY newsid DESC LIMIT 10";  //新闻资讯
$result = $db->query($sql);
$news = $db->fetch_all($result);

$sql = "SELECT * FROM services LIMIT 6";                 //服务展示
$result = $db->query($sql);
$service = $db->fetch_all($result);

$sql = "SELECT * FROM slidead WHERE isdisplay=1 ORDER BY adid DESC LIMIT 5";             //幻灯图
$result = $db->query($sql);
$slide = $db->fetch_all($result);

$sql = "SELECT * FROM cases ORDER BY caseid DESC LIMIT 9";   //案例展示
$result = $db->query($sql);
$cases = $db->fetch_all($result);

$sql = "SELECT * FROM article WHERE articleid = 3";   //文章
$result = $db->query($sql);
$why = $db->fetch_one($result);

$sql = "SELECT * FROM article WHERE articleid = 8";   //文章
$result = $db->query($sql);
$service_type = $db->fetch_one($result);

$smarty->assign("news",$news);

$smarty->assign("service",$service);
$smarty->assign("service_src",$service_src);

$smarty->assign("slide",$slide);

$smarty->assign("cases",$cases);

$smarty->assign("why",$why);
$smarty->assign("service_type",$service_type);

$smarty->display("index.tpl");
$db->close();
?>


